| Filename | (eval 30)[/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5/Fatal.pm:1188] |
| Statements | Executed 5 statements in 39µs |
| Eval Invoked At | /home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5/Fatal.pm line 1188 |
| Sibling evals | 1, 2 |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 27µs | 29µs | Hailo::__ANON__[:47] |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | |||||
| 2 | package Hailo; | ||||
| 3 | |||||
| 4 | # spent 29µs (27+3) within Hailo::__ANON__[(eval 30)[/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5/Fatal.pm:1188]:47] which was called:
# once (27µs+3µs) by Hailo::train at line 227 of lib/Hailo.pm | ||||
| 5 | |||||
| 6 | # If we're inside a string eval, we can end up with a | ||||
| 7 | # whacky filename. The following code allows autodie | ||||
| 8 | # to propagate correctly into string evals. | ||||
| 9 | |||||
| 10 | 1 | 2µs | my $caller_level = 0; | ||
| 11 | |||||
| 12 | 1 | 700ns | my $caller; | ||
| 13 | |||||
| 14 | 1 | 17µs | 1 | 3µs | while ( ($caller = (caller $caller_level)[1]) =~ m{^\(eval \d+\)$} ) { # spent 3µs making 1 call to Hailo::CORE:match |
| 15 | |||||
| 16 | # If our filename is actually an eval, and we | ||||
| 17 | # reach it, then go to our autodying code immediatately. | ||||
| 18 | |||||
| 19 | goto &$code if ($caller eq $filename); | ||||
| 20 | $caller_level++; | ||||
| 21 | } | ||||
| 22 | |||||
| 23 | # We're now out of the eval stack. | ||||
| 24 | |||||
| 25 | # If we're called from the correct file, then use the | ||||
| 26 | # autodying code. | ||||
| 27 | 1 | 14µs | 1 | 136µs | goto &$code if ((caller $caller_level)[1] eq $filename); # spent 136µs making 1 call to Hailo::__ANON__[(eval 29)[Fatal.pm:1102]:127] |
| 28 | |||||
| 29 | # Oh bother, we've leaked into another file. Call the | ||||
| 30 | # original code. Note that $sref may actually be a | ||||
| 31 | # reference to a Fatalised version of a core built-in. | ||||
| 32 | # That's okay, because Fatal *always* leaks between files. | ||||
| 33 | |||||
| 34 | goto &$sref if $sref; | ||||
| 35 | |||||
| 36 | if (@_ == 1) { | ||||
| 37 | return CORE::open($_[0]); | ||||
| 38 | } | ||||
| 39 | |||||
| 40 | if (@_ == 2) { | ||||
| 41 | return CORE::open($_[0], $_[1]); | ||||
| 42 | } | ||||
| 43 | |||||
| 44 | if (@_ == 3) { | ||||
| 45 | return CORE::open($_[0], $_[1], @_[2..$#_]); | ||||
| 46 | } | ||||
| 47 | Carp::croak("Internal error in Fatal/autodie. Leak-guard failure"); } | ||||
| 48 | 1 | 5µs | ; |